package cn.tedu.cat.mapper;

import cn.tedu.cat.entity.Comment;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CommentMapper {
    @Insert("insert into comment values" +
            "(null,#{content},#{author},#{created},#{weiboId})")
    void insert(Comment comment);


    @Select("select id,content,author,created from comment where weibo_id=#{id}")
    List<Comment> selectByWeiboId(int id);



}
